var express = require('express');
const UserController = require('../../controllers/admin/UserController');
var UserRouter = express.Router();
//图片上传
const multer = require("multer")
const upload = multer({dest:"public/avataruploads/"})
// 朝这个路径发送请求  就会进UserController方法
UserRouter.post("/adminapi/user/login",UserController.login)
UserRouter.post("/adminapi/user/upload",upload.single("file"),UserController.upload)
UserRouter.post("/adminapi/user/add",upload.single("file"),UserController.add)
UserRouter.get("/adminapi/user/list",UserController.getList)
UserRouter.get("/adminapi/user/list/:id",UserController.getList)
UserRouter.put("/adminapi/user/list/:id",UserController.putList)
UserRouter.delete("/adminapi/user/list/:id",UserController.delList)

// UserRouter.get("/adminapi/user/captcha",UserController.captcha)

 
module.exports = UserRouter;
